import React from "react"

export default function Square(props) {
  let isWinSquare = false
  if (props.winLines) {
    props.winLines.map(item => {
      if (item === props.id) {
        isWinSquare = true
      }
    })
  }
  return (
    <button
      className={isWinSquare ? "square winSquare" : "square"}
      onClick={props.onClick}
    >
      {props.value}
    </button>
  )
}
